/*
 * DIOCE.h
 *
 *  Export File - DIO Types
 *
 *  Created on: 16/11/2012
 *      Author: Richard
 */

#ifndef DIOCE_H_
#define DIOCE_H_

typedef enum
{
   tLo = 0u,
   tHi = 1u
} DIO_tenLogicLevel;

typedef enum
{
   DIO_nen_DataDirection_Input   = 0u,
   DIO_nen_DataDirection_Output  = 1u
} DIO_tenDataDirection;

typedef enum
{
   DIO_nen_InterruptEdge_FallingEdge   = 0u,
   DIO_nen_InterruptEdge_RisingEdge    = 1u
} DIO_tenInterruptEdgeSelect;

typedef enum
{
   DIO_nen_DriveStrength_Reduced = 0u,
   DIO_nen_DriveStrength_Full    = 1u
} DIO_tenDriveStrength;

typedef enum
{
   DIO_nen_PortSelect_IO         = 0u,
   DIO_nen_PortSelect_Peripheral = 1u
} DIO_tenPortSelect;

typedef enum
{
   DIO_nenFirstPin      = 0u,

   DIO_nenButton        = 0u,
   DIO_nenLED_Bar_1     = 1u,
   DIO_nenLED_Bar_2     = 2u,
   DIO_nenXTAL1         = 3u,
   DIO_nenXTAL2         = 4u,

   DIO_nenADC1          = 5u,
   DIO_nenADC2          = 6u,

   DIO_nenPWM           = 7u,

   DIO_nenTEST          = 8u,
   DIO_nenTEST2         = 9u,

   DIO_nenNumberOfPins  = 10u
} DIO_tenPinName;

/* Fast SET */
/* PORTA */
#define MSP430_FAST_SET_PIN_LED_Bar_1     PAOUT |= ( 1 << 0 )
#define MSP430_FAST_SET_PIN_TEST2         PAOUT |= ( 1 << 4 )
#define MSP430_FAST_SET_PIN_TEST          PAOUT |= ( 1 << 6 )
/* PORTB */
#define MSP430_FAST_SET_PIN_LED_Bar_2     PBOUT |= ( 1 << 6 )

/* Fast CLEAR */
/* PORTA */
#define MSP430_FAST_CLEAR_PIN_LED_Bar_1   PAOUT &= ~( 1 << 0 )
#define MSP430_FAST_CLEAR_PIN_TEST2       PAOUT &= ~( 1 << 4 )
#define MSP430_FAST_CLEAR_PIN_TEST        PAOUT &= ~( 1 << 6 )
/* PORTB */
#define MSP430_FAST_CLEAR_PIN_LED_Bar_2   PBOUT &= ~( 1 << 6 )

/* Fast Toggle */
#define MSP430_FAST_TOGGLE_PIN_TEST2      PAOUT ^= ( 1 << 4 )

#endif /* DIOCE_H_ */
